home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / doc / das.doc < prev    next >
Text File  |  1994-02-13  |  5KB  |  154 lines

  1.  
  2. das/das                             das/das
  3.  
  4.             DAS ASSEMBLY DOCUMENTATION
  5.  
  6.  
  7.                   Matthew Dillon
  8.                   891 Regal Rd.
  9.                   Berkeley, Ca. 94708
  10.                   USA
  11.  
  12.                   uunet.uu.net!overload!dillon
  13.  
  14.  
  15.  
  16.     DAS asmfile [-o objectfile] [-E errorfile] [-nu]
  17.  
  18.     DAS is a minimal 68000 assembler designed to assemble the output of DC1
  19.  
  20.     DAS SHOULD NOT BE USED FOR ASSEMBLY PROJECTS, IT IS MEANT SOLELY TO DEAL
  21.     WITH THE OUTPUT FROM THE COMPILER.
  22.  
  23.                 OPTIONS
  24.  
  25.     -o objfile        specify object file, else uses asmfile.o (after
  26.             removing any trailer after the .)
  27.  
  28.     -E errorfile    specify file for errors, else stderr is used
  29.  
  30.     -nu         specify that the HUNK_UNIT have no name (for
  31.             libraries, to make the library smaller)
  32.  
  33.  
  34.  
  35.     NOTE:
  36.         Das cannot handle expressions other than simple +,-,*, and /,
  37.         and only one address label is allowed per expression (i.e.
  38.         value unknown until link or load)
  39.  
  40.         Das does not understand integral types other than decimal and hex.
  41.  
  42.         Das does not understand strings 'string'.
  43.  
  44.         Das cannot export EQU labels (i.e. ABS references).
  45.  
  46.         Das has no macro facilities
  47.  
  48.                     FEATURES
  49.  
  50.     Das includes optimization features used by the compiler.  Also, Das can
  51.     handle arbitrary forward referenced REG labels for MOVEM which most
  52.     assemblers cannot.
  53.  
  54.     Das allows and automatically coagulates multiple occurances of section
  55.     directives of the same name and type.
  56.  
  57.     Das automatically pads CODE sections with NOPs instead of 0's.  However,
  58.     DS.L will always pad with 0.
  59.  
  60.  
  61.     DAS handles the following directives:
  62.  
  63.     DC        declare data
  64.     DS        declare space / align
  65.  
  66.     SECTION     declare a section.  Sections may be repeated to flip
  67.             back and forth between them.  A third argument
  68.             may contain a value to be ORd with the hunk
  69.             type field, usually used to specify special
  70.             hunk flags (i.e. hunk to chip memory, etc...)
  71.  
  72.     XREF        import a label
  73.     XDEF        export a label
  74.     EQU        declare a constant (must be a numerical constant)
  75.     REG        declare zero or more registers in register list
  76.  
  77.     PROCSTART    used to determine procedure boundries for A5 check/
  78.     PROCEND     link/unlk removal.  Also automatically sets optimization
  79.             option to 1 if 0.
  80.  
  81.     DAS handles the following expressions:
  82.  
  83.     +, -, *, /, negation.  Only one relocatable label allowed per
  84.     expression. Any number of EQU'd labels allowed, forward or reverse
  85.     referenced.
  86.  
  87.     Optimization level 0 (default unless PROCSTART exists in file)
  88.  
  89.     * MOVEM's using 'reg' labels are optimized to either a MOVE or by
  90.       removing the MOVEM entirely (reg labels that specify no registers).
  91.  
  92.     * BRANCHES to BRAs are optimized (up to 20 hops)
  93.     * unsized BRANCHES are optimized to byte branches if possible
  94.     * BRANCHES to the next instruction are deleted
  95.  
  96.     Optimization level 1  (automatic if PROCSTART exists in file)
  97.  
  98.     * LINK/UNLK within PROCSTART/PROCEND bounds is removed if the link
  99.       register (currently hardwired to be A5) is never referenced AND if
  100.       no subroutine calls are made within the procedure (JSR's or BSR's)
  101.  
  102.       This allows support of stack backtraces while optimizing most low
  103.       level routines written in C.    Removal of LINK/UNLK in routines that
  104.       make other subroutine calls does not yield much of an efficiency
  105.       boost anyway.
  106.  
  107.                     PROBLEMS
  108.  
  109.     DAS Uses an incredible amount of memory due to efficiency considerations
  110.     in the optimization and myself wanting to keep it FAST.
  111.  
  112.     When specifying DIFFERENTLY NAMED CODE SECTIONS in the SAME ASSEMBLY FILE,
  113.     keep in mind that the code sections are not necessarily near to each other
  114.     in the final link and the linker cannot generate a jump table for
  115.     PC-Relative inter-module calls.  Thus, one section calling another should
  116.     not use PC-Relative unless you *know* your final executable is going to
  117.     be less than 32K *AND* you do not use the -frag option to dlink.
  118.  
  119.     This is why the startup c.a references the autoinit sections with
  120.     absolute calls instead of PC-relative calls.
  121.  
  122.                EFFECTIVE ADDRESS
  123.  
  124.     Dn    - data register D0-D7
  125.     An    - addr register D0-D7
  126.     .z    - size (.W or .L)
  127.     *s    - 68020 scale (*1, *2, *4, *8)
  128.  
  129.     bd    - base displacement expression, Usually followed by base
  130.       displacement size or (A4) to indicate a data-relative
  131.       relocation.  Example:   xx+4.L  xx.W     23+xx(A4)
  132.  
  133.     od    - outer displacement expression, like bd.  Only allowed if an
  134.       indirection [] is used.
  135.  
  136.                 68000   68020/030
  137.     Dn                  x     x
  138.     An                  x     x
  139.     (An)                      x         x
  140.     (An)+                     x         x
  141.     -(An)                     x         x
  142.     d16(An)                   x         x
  143.     d8(An,Dn.z)               x         x
  144.     d8(An,Dn.z*s)                       x
  145.     (bd.z/(A4),An,Dn.z*s)               x     all items optional
  146.  
  147.     example: (foo(A4),A4,D0.W*8)
  148.          (bar.L,D2.W*8)
  149.  
  150.     ([bd.z/(A4),An],Dn.z*s,od)          x
  151.     ([bd.Z/(A4),An,Dn.z*s],od)          x
  152.  
  153.  
  154.